Overall Score
Correct Answers
Questions
Wrong Answers
Questions
Time Taken
Duration
Student Information
Exam Information
Question-wise Analysis
0): ?> $answer): ?>No detailed answer data available for this result.
prepare($query); $stmt->execute([$result_id]); $result = $stmt->fetch(PDO::FETCH_ASSOC); if (!$result) { $_SESSION['error'] = "Result not found!"; redirect('view_results.php'); } // Get student answers for this result $query = " SELECT sa.*, q.question_text, q.option_a, q.option_b, q.option_c, q.option_d, q.correct_answer, q.marks FROM student_answers sa JOIN questions q ON sa.question_id = q.id WHERE sa.session_id = ? ORDER BY sa.question_id "; $stmt = $pdo->prepare($query); $stmt->execute([$result['session_id']]); $student_answers = $stmt->fetchAll(PDO::FETCH_ASSOC); // Calculate statistics $total_questions = $result['total_questions']; $correct_answers = $result['correct_answers']; $wrong_answers = $result['total_questions'] - $result['correct_answers']; $percentage = $result['percentage']; $questions_attempted = $result['questions_attempted']; $questions_skipped = $total_questions - $questions_attempted; // Calculate time taken $start_time = new DateTime($result['start_time']); $end_time = new DateTime($result['end_time']); $duration = $start_time->diff($end_time); $duration_display = $duration->h > 0 ? sprintf('%dh %dm %ds', $duration->h, $duration->i, $duration->s) : sprintf('%dm %ds', $duration->i, $duration->s); // Determine performance level if ($percentage >= 80) { $performance_level = 'Excellent'; $performance_class = 'text-success'; } elseif ($percentage >= 60) { $performance_level = 'Good'; $performance_class = 'text-primary'; } elseif ($percentage >= 40) { $performance_level = 'Average'; $performance_class = 'text-warning'; } else { $performance_level = 'Poor'; $performance_class = 'text-danger'; } ?>
Detailed analysis of student performance
Questions
Questions
Duration
No detailed answer data available for this result.